package com.yisu.auction.api.core.mapper;

import com.yisu.auction.api.domain.request.BasePage;
import com.yisu.auction.api.domain.request.memberPackage.AddressRequest;
import com.yisu.auction.api.domain.vo.PrizePackageVos.ReceivingAddressVo;
import com.yisu.auction.ewf.entity.Address;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface AddressMapper {
    int deleteByPrimaryKey(Long id);

    int insert(Address record);

    int insertSelective(Address record);

    Address selectByPrimaryKey(Long id);

    int updateByPrimaryKeySelective(Address record);

    int updateByPrimaryKey(Address record);

    /**
     * author:黄萧林
     * Business Description:获取当前收货地址信息
     * @param id
     * @return
     */
    ReceivingAddressVo getReceivingAddressInfo(Long id);

    /**
     * author:黄萧林
     * Business Description:获取我的收货地址列表
     * @param basePage
     * @return
     */
    List<ReceivingAddressVo> getMineReceivingAddressList(BasePage basePage);

    /**
     * author:赵杰
     * Business Description:通过会员ID取消所有默认地址
     * @param memberId
     * @return
     */
    int cancelDefaultAddressByMemberId(@Param("memberId") Long memberId);


    /**
     * author:赵杰
     * Business Description:通过主键及memberId删除
     * @param addressRequest
     * @return
     */
    int deleteByMemberIdAndPrimary(AddressRequest addressRequest);

    /**
     * author:赵杰
     * Business Description: 通过会员ID获取默认收货地址
     * @param memberId
     * @return
     */
    ReceivingAddressVo getDefaultAddressByMemberId(@Param("memberId") Long memberId);
}